package com.mq.conf;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 负载均衡配置类
 */
//@Configuration
public class Balance {

    @Bean
    @LoadBalanced //这个注解可用使下面注入的rt 具备负载均衡的能力
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
